package cn.doitedu.marketing.engine.gauges;

import org.apache.flink.metrics.Gauge;

/***
 * @author hunter.d
 * @qq 657270652
 * @wx haitao-duan
 * @date 2021/7/26
 **/
public class AvgGauge implements Gauge<Float> {
        long count = 0;
        long timeAmount = 0;
        @Override
        public Float getValue() {
            return (float)timeAmount/count;
        }
        public void inc(long time){
            this.count ++;
            this.timeAmount += time;
        }
}
